﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Entities;
namespace Stationery
{
    public partial class StationeryAdmin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[Utils.SESSION_LOGIN] == null)
            {
                Response.Redirect(UtilsURL.home);
                return;
            }

            if (!IsPostBack)
            {
                Set_Advertise();
                Set_Menu_Header();
            }
        }

        private void Set_Advertise()
        {
            // Hien thi quang cao cho menu ben phai
            // co the hien thi quang cao cho menu ben trai (loai dac biet)
        }

        private void Set_Menu_Header()
        {
            // Tao menu cho phan header
            BLL_MenuURL bll_MenuURL  = new BLL_MenuURL();
            List<MenuURL> lstMenuURL = bll_MenuURL.Lst_MenuURL(bll_MenuURL.Get_MenuURL_Type(MenuURL.row));

            foreach (MenuURL menuURL in lstMenuURL)
            {
                ASPxMenuHeader.Items.Add(menuURL.NAME, menuURL.SEQUENCE.ToString(), menuURL.IMAGE_DIRECTORY, menuURL.URL);
            }
        }
    }
}
